package view.graph
{
	import mx.collections.ArrayCollection;

	public class GraphQualityError extends CustomLineChart
	{
		
		private var _seriseFieldName:Array = ["totalmediaalarm_ref","totalmediaalarm"];
		private var _seriseDisPlayName:Array = ["R값(지난주)","R값"];
		private var _strokeArray:Array 			= [0x00baff,0xff0037];
		
		public function GraphQualityError()
		{
			
			legendWidth = 134;
			super();
		}
		override public function get seriseFieldName():Array
		{
			return _seriseFieldName;
		}
		override public function get seriseDisPlayName():Array
		{
			return _seriseDisPlayName;
		}
		override public function get strokeArray():Array
		{
			return _strokeArray;
		}
		override protected function getFixed(value:Number):String
		{
			return value.toFixed(2);
		}
		override public function setGraphData($data:*):void
		{
			if(graphData)
				graphData.removeAll();
			graphData= new ArrayCollection();
			var c:int = 0;
			
			_data = $data;
			if(_data.hasOwnProperty("ho"))
				c = _data.ho.time.length;
			
			maxValue = 0;
			for(var i:int = 0;i<c;i++)
			{
				//_seriseFieldName[i]	
				//var obj:Object = getGraphObject(i);
				maxValue = setMaxValue(maxValue,_data.ho.totalmediaalarm[i],_data.ho_ref.totalmediaalarm[i]);
				var obj:Object = {
						totalmediaalarm		: _data.ho.totalmediaalarm[i]
					,	totalmediaalarm_ref	: _data.ho_ref.totalmediaalarm[i]
					,	time			: _data.ho.time[i]
				}; 
				graphData.addItem(obj)
			}
			//maxValue = setMaxValue(maxValue,1.10);
			//	trace(graphData);
			drawGraph();
		}
	}
}